const express = require('express')
const app = express()
// app.use(express.urlencoded({ extended: true })) //解析请求主体
app.use(express.json())
// 使用路由接口
const indexRouter = require('./routes/test.js')
app.use('/', indexRouter)
// 启动服务器
const http = require('http')
const server = http.createServer(app)
server.listen('3000')
console.log('服务器已启动!端口地址为http://localhost:3000')